package com.xuda.springboot.service.Impl;

import com.xuda.springboot.dao.EmployeeMapper;
import com.xuda.springboot.pojo.Employee;
import com.xuda.springboot.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author ：程序员徐大大
 * @description：TODO
 * @date ：2022-03-21 15:32
 */
@Service
@Transactional
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;
    //查询全部员工信息
    @Override
    public List<Employee> lists() {
       return employeeMapper.lists();
    }

    @Override
    public void save(Employee employee) {
        employeeMapper.save(employee);
    }

    @Override
    public Employee findById(Integer id) {
        return employeeMapper.findById(id);
    }

    @Override
    public void update(Employee employee) {
        employeeMapper.update(employee);
    }

    @Override
    public void delete(Integer id) {
        employeeMapper.delete(id);
    }


}
